extends Node2D
class_name BaseCell
@onready var model: Sprite2D = $Model
var disable_build_types : Array = [
	BaseGrid.TYPE.BAN_BUILD
]
var xy : Vector2i
var model_type : Texture2D
var cell_type : BaseGrid.TYPE

func _ready() -> void:
	_set_model_type()

func _init_model(_xy : Vector2i) -> void :
	xy = _xy

func _init_pos(size : Vector2i) -> void :
	position = xy * size

func _set_model_type() -> void :
	model.texture = BaseGrid.MODEL_TYPE[cell_type]

func _reset_cell_type(_ct : BaseGrid.TYPE = BaseGrid.TYPE.BAN_BUILD) -> void :
	cell_type = _ct
	_set_model_type()

func _check_disable_build() -> bool :
	return disable_build_types.has(cell_type)

func _visible_ban_cell(value : bool) -> void :
	if _check_disable_build() :
		visible = value
